package com.linkage.jz.bankruptcy.bean.Vote;

import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.linkage.jz.bankruptcy.adapter.expand.model.ExpandableListItem;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * 表决人明细 对象
 */
public class ProVoteVotersDetailGroup implements ExpandableListItem, Serializable {

    public boolean mExpanded = false;
    private String id;//参会表决人记录id
    private String name;
    private String code;
    private boolean canDelete;
    private boolean ordinary;
    private boolean guarantee;
    private boolean other;
    private String voteId;
    private int sort;
    private double totalVoteMoney;
    private int memberCount;

    private boolean requestChild;
    private List<ProVoteVotersDetail> childs;

    public static List<ProVoteVotersDetailGroup> parse(JsonArray arr) {
        List<ProVoteVotersDetailGroup> list = new ArrayList<>();
        for (int i = 0; i < arr.size(); i++) {
            list.add(parse(arr.get(i).getAsJsonObject()));
        }
        return list;
    }

    public static ProVoteVotersDetailGroup parse(JsonObject obj) {
        ProVoteVotersDetailGroup bean = new Gson().fromJson(obj, ProVoteVotersDetailGroup.class);
        return bean;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public boolean isCanDelete() {
        return canDelete;
    }

    public void setCanDelete(boolean canDelete) {
        this.canDelete = canDelete;
    }

    public boolean isOrdinary() {
        return ordinary;
    }

    public void setOrdinary(boolean ordinary) {
        this.ordinary = ordinary;
    }

    public boolean isGuarantee() {
        return guarantee;
    }

    public void setGuarantee(boolean guarantee) {
        this.guarantee = guarantee;
    }

    public boolean isOther() {
        return other;
    }

    public void setOther(boolean other) {
        this.other = other;
    }

    public String getVoteId() {
        return voteId;
    }

    public void setVoteId(String voteId) {
        this.voteId = voteId;
    }

    public int getSort() {
        return sort;
    }

    public void setSort(int sort) {
        this.sort = sort;
    }

    public double getTotalVoteMoney() {
        return totalVoteMoney;
    }

    public void setTotalVoteMoney(double totalVoteMoney) {
        this.totalVoteMoney = totalVoteMoney;
    }

    public int getMemberCount() {
        return memberCount;
    }

    public void setMemberCount(int memberCount) {
        this.memberCount = memberCount;
    }

    public boolean isRequestChild() {
        return requestChild;
    }

    public void setRequestChild(boolean requestChild) {
        this.requestChild = requestChild;
    }

    public List<ProVoteVotersDetail> getChilds() {
        return childs;
    }

    public void setChilds(List<ProVoteVotersDetail> childs) {
        this.childs = childs;
    }

    @Override
    public List<?> getChildItemList() {
        return getChilds();
    }

    @Override
    public boolean isExpanded() {
        return mExpanded;
    }

    @Override
    public void setExpanded(boolean isExpanded) {
        mExpanded = isExpanded;
    }
}
